import { ADD_COUNTER, ADD_TO_CART } from './mutations-type';
export default {
    // 将事件解构
    // payload是action是中传入的oldProduct
    [ADD_COUNTER](state, payload) {
        payload.count++
    },

    [ADD_TO_CART](state, payload) {
        payload.checked = true
        state.cartList.push(payload)
    },

    oldCartList(state, payload){
        state.cartList = payload
    }
}